<%@ page language="java" import="java.util.*" pageEncoding="UTF-8"%>
<%@ taglib prefix="c" uri="http://java.sun.com/jsp/jstl/core"%>
<%@ taglib uri="http://java.sun.com/jsp/jstl/fmt" prefix="fmt"%>
<link href="${pageContext.request.contextPath }/statics/AmazeUI-2.4.2/cartstyle.css" rel="stylesheet" type="text/css" />
<link href="${pageContext.request.contextPath }/statics/AmazeUI-2.4.2/jsstyle.css" rel="stylesheet" type="text/css" />
<%@include file="common/header.jsp"%>

<!--物流 -->
					
					<!--订单 -->
					<form action="${pageContext.request.contextPath }/index/save" id="form" method="post">
					<div class="concent">
						<div id="payTable">
							<h3>确认订单信息</h3>
							<div class="cart-table-th">
								<div class="wp">

									<div class="th th-item">
										<div class="td-inner">商品信息</div>
									</div>
									<div class="th th-price">
										<div class="td-inner">单价</div>
									</div>
									<div class="th th-amount">
										<div class="td-inner">数量</div>
									</div>
									<div class="th th-sum">
										<div class="td-inner">金额</div>
									</div>

								</div>
							</div>
							<div class="clear"></div>
						
							<tr class="item-list">
								<div class="bundle  bundle-last">

									<div class="bundle-main">
										<ul class="item-content clearfix">
											<div class="pay-phone">
												<li class="td td-item">
													<div class="item-pic">
														<a href="#" class="J_MakePoint">
															<img src="/pic/${brand.org_pic}" class="itempic J_ItemImg"></a>
															<input type="hidden" value="${brand.org_pic}" name="org_pic"/>
													</div>
													<div class="item-info">
														<div class="item-basic-info">
															<a href="#" class="item-title J_MakePoint" data-point="tbcart.8.11">${brand.title}<input type="hidden" name="title" value="${brand.title}"/></a>
														</div>
													</div>
												</li>
												<li class="td td-info">
													<div class="item-props">
														<span class="sku-line">出发城市：${area}</span><br/><br/>
														<span class="sku-line">出发日期：
															<input type="text" Class="Wdate" id="usingDate" name="usingDate"  value='<fmt:formatDate value="${brand.usingDate}"/>'
															readonly="readonly" onclick="WdatePicker();"/>
														</span>
													</div>
												</li>
												<li class="td td-price">
													<div class="item-price price-promo-promo">
														<div class="price-content">
															<em class="J_Price price-now">${brand.price}<input type="hidden" id="price" name="price" value="${brand.price}"/></em>
														</div>
													</div>
												</li>
											</div>
											<li class="td td-amount">
												<div class="amount-wrapper ">
													<div class="item-amount ">
														<span class="phone-title">购买数量</span>
														<div class="sl">
															<input id="min" class="min am-btn" name="" type="button" value="-" />
															<input class="text_box" name="count" id="count" type="text" value="${count}" style="width:30px;" />
															<input id="add" class="add am-btn" name="" type="button" value="+" />
														</div>
													</div>
												</div>
											</li>
											<li class="td td-sum">
												<div class="td-inner">
													<em tabindex="0" class="J_ItemSum number" id="totalPrice">${totalPrice}</em>
												</div>
											</li>

										</ul>
										<div class="clear"></div>

									</div>
							</tr>
							<div class="clear"></div>
							</div>

							
							</div>
							<div class="clear"></div>
							<div class="pay-total">
						<!--联系人信息-->
							<div class="order-extra">
								<div class="order-user-info">
									<div id="holyshit257" class="memo">
										<label>联系人信息</label><br/><br/>
										<i style="color:red;">*</i>联系人名称: <input type="text" id="contact" name="contact"  placeholder="填写联系人姓名" class="memo-input J_MakePoint c2c-text-default memo-close" style="width:30px;"><span id="span1" style="color:red;" value=""></span><br/><br/>
										<i style="color:red;">*</i>联系人电话: <input type="text" id="phone" name="phone" placeholder="填写联系人电话" class="memo-input J_MakePoint c2c-text-default memo-close" style="width:30px;"><span id="span2" style="color:red;" value=""></span><br/><br/>
										联系人邮箱: <input type="text" title="" placeholder="填写联系人邮箱" class="memo-input J_MakePoint c2c-text-default memo-close" style="width:30px;">
									</div>
								</div>

							</div>
							
							<div class="clear"></div>
							</div>
							<div class="pay-total">
						<!--出游人信息-->
							<div class="order-extra">
								
								<div class="order-user-info a">
									<!-- <div id="holyshit257" class="memo">
										<label>出游人信息</label><br/><br/>
										<i style="color:red;">*</i>中文名称: <input type="text" title="" id="t_Name" name="t_Name" placeholder="请与证件保持一致" class="memo-input J_MakePoint c2c-text-default memo-close"><br/><br/>
										<i style="color:red;">*</i>证件类型: <input type="text" title="" id="ID_Card" name="ID_Card" placeholder="填写正确的证件号码" class="memo-input J_MakePoint c2c-text-default memo-close"><br/><br/>
										<i style="color:red;">*</i>手机号码: <input type="text" title="" id="t_Phone" name="t_Phone" placeholder="" class="memo-input J_MakePoint c2c-text-default memo-close">
									</div> -->
								</div>

							</div>
							
							<div class="clear"></div>
							</div>
							<!--含运费小计 -->
							<div class="buy-point-discharge ">
								<p class="price g_price ">
									合计 <span> ¥ </span><em class="pay-sum"  id="totalPrice1"> ${totalPrice} <input type="hidden" value="${totalPrice}" name="totalPrice" id="totalPriceInput"/></em>
								</p>
							</div>

							<!--信息 -->
							<div class="order-go clearfix">
								<div class="pay-confirm clearfix">
									<div class="box">
										<div tabindex="0" id="holyshit267" class="realPay"><em class="t">实付款：</em>
											<span class="price g_price ">
                                    <span>¥</span> <em class="style-large-bold-red " id="J_ActualFee">${totalPrice}</em>
											</span>
										</div>

										<div id="holyshit268" class="pay-address">
											<p class="buy-footer-address">
												<span class="buy-line-title">联系人：<span></span></span>
												<span class="buy-address-detail">   
                                         <span class="buy-user"> </span>
												<span class="buy-phone"></span>
												</span>
											</p>
										</div>
									</div>
									
									<div id="holyshit269" class="submitOrder">
										<div class="go-btn-wrap">
											<a id="J_Go" href="javascript:;"  class="btn-go" tabindex="0" title="点击此按钮，提交订单">提交订单</a>
										</div>
									</div>
									<input type="hidden" value="" name="isPay" id="isPay"/>
									<input type="hidden" value="${brand.createBy}" name="p_createBy"/>
									<div class="clear"></div>
								</div>
							</div>
						</div>
						<div class="clear"></div>
					</div>
				</div>
				</form>
<%@include file="common/footer.jsp"%>
<script>
	var add = $("#add");
	var min = $("#min");
	var count = $("#count").val();
	
	var a = $(".a");
	var _a = "<br/><div class='memo'><label>出游人信息</label><br/><br/>"
				+"<i style='color:red;'>*</i>中文名称: <input type='text' title=''  name='t_Name' placeholder='请与证件保持一致' class='memo-input J_MakePoint c2c-text-default memo-close t_Name' style='width:30px;'><span style='color:red;'></span><br/><br/>"
				+"<i style='color:red;'>*</i>证件类型: <input type='text' title=''  name='ID_Card' placeholder='填写正确的证件号码' class='memo-input J_MakePoint c2c-text-default memo-close ID_Card' style='width:30px;'><span style='color:red;'></span><br/><br/>"
				+"<i style='color:red;'>*</i>手机号码: <input type='text' title=''  name='t_Phone' placeholder='' class='memo-input J_MakePoint c2c-text-default memo-close t_Phone' style='width:30px;'><span style='color:red;'></span></div>";
	
	for(var i=0 ; i<count;i++){
		a.append(_a);
	}
	
	add.on("click",function(){
		var price = $("#price").val();
		var totalPrice = $("#totalPrice");
		var totalPrice1 = $("#totalPrice1");
		var count = $("#count").val();
		count++;
		totalPrice.html(price*count);
		totalPrice1.html(price*count);
		$("#J_ActualFee").html(price*count);
		
		var orderinfo = $(".a");
		var a = "<br/><div class='memo'><label>出游人信息</label><br/><br/>"
				+"<i style='color:red;'>*</i>中文名称: <input type='text' title=''  name='t_Name' placeholder='请与证件保持一致' class='memo-input J_MakePoint c2c-text-default memo-close t_Name' style='width:30px;'><span style='color:red;'></span><br/><br/>"
				+"<i style='color:red;'>*</i>证件类型: <input type='text' title=''  name='ID_Card' placeholder='填写正确的证件号码' class='memo-input J_MakePoint c2c-text-default memo-close ID_Card' style='width:30px;'><span style='color:red;'></span><br/><br/>"
				+"<i style='color:red;'>*</i>手机号码: <input type='text' title=''  name='t_Phone' placeholder='' class='memo-input J_MakePoint c2c-text-default memo-close t_Phone' style='width:30px;'><span style='color:red;'></span></div>";
		orderinfo.append(a);
	});
	min.on("click",function(){
		var price = $("#price").val();
		var totalPrice = $("#totalPrice");
		var totalPrice1 = $("#totalPrice1");
		var count = $("#count").val();
		count--;
		totalPrice.html(price*count);
		totalPrice1.html(price*count);
		$("#J_ActualFee").html(price*count);
		$("#totalPriceInput").val(price*count);
		
		$(".memo").last().remove();
	});
	
	$("#contact").on("blur",function(){
		if($(this).val == null || $(this).val() == ""){
			$("#span1").html("请填写联系人名称!!!");
			$("#span1").val("");
		}else{
			$("#span1").html("");
			$("#span1").val("1");
		}
		var contact = $(this).val();
		$(".buy-line-title>span").html(contact);
	});
	
	$("#phone").on("blur",function(){
		if($(this).val() == null || $(this).val() == ""){
			$("#span2").html("请填写联系人电话!!!");
			$("#span2").val("");
		}else{
			$("#span2").html("");
			$("#span2").val("1");
		}
		
		if($(this).val().length != 11){
			$("#span2").html("电话少于11位!!!");
			$("#span2").val("");
		}else{
			$("#span2").html("");
			$("#span2").val("1");
		}
		
	});
	
	$("#J_Go").on("click",function(){
		var span1 = $("#span1").val();
		var span2 = $("#span2").val();
		if((span1 == null || span1 == "") || (span2 == null || span2 == "") ){
			alert("请填写好必要的信息!!!!!!!!!!");
			return false;
		}else{
			var totalPriceInput = $("#totalPriceInput").val();
			if(confirm("是否支付"+totalPriceInput+"元？")){
				$("#isPay").val("1");
				$("#form").submit();
			}else{
				$("#isPay").val("0");
				$("#form").submit();
			}
		}
	});
	
</script>
<script src="${pageContext.request.contextPath }/statics/root.js/pay.js"></script>